package com.dingup.provider.mapper;

import com.dingup.api.adapter.student.StudentCourseInformationAdapter;
import com.dingup.api.model.student.StudentCourseInformation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface StudentCourseInformationMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(StudentCourseInformation record);

    int insertSelective(StudentCourseInformation record);

    StudentCourseInformation selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(StudentCourseInformation record);

    int updateByPrimaryKey(StudentCourseInformation record);

    List<StudentCourseInformationAdapter> getByUserId(String userId);

    List<StudentCourseInformation> getByContributionAmountOrSalerIsNull(String studentId);

    List<StudentCourseInformation> getByClassIdIsNull(String studentId);

    List<StudentCourseInformation> getByUserIdAndLessonIdAndClassId(StudentCourseInformation studentCourseInformation);


    Integer getStudentUnDivideCount(Integer lessonId);

    List<StudentCourseInformationAdapter> getStudentUnDivide(Integer lessonId);

    StudentCourseInformation getByStudentIdAndClassId(@Param("studentId") String studentId,
                                                      @Param("classId") Integer classId);
}